import Acceleration2D from "../../standard/entities/Movement/Acceleration2D";
import Point2D from "../../standard/entities/Point/Point2D";

export default class GravitationAcceleration2D extends Acceleration2D {

    constructor(gravitationCentre = new Point2D(), a = 0) {
        super(a);
        this.a = a;
        this.gravitationCentre = gravitationCentre;
    }

    appliedTo(acceleration, point, movement) {
        this.angle = point['getDegFromAnotherPoint'](this.gravitationCentre);
        this.acceleration = this.a;
        super.appliedTo(acceleration, point, movement);
    }
}